<script id="content" type="text/template">
	
	<!--if{response.type_parent_get}-->
	<div class="panel panel-default">
		<div class="panel-body">
			<!--if{response.type_parent_get.type_logo_image_id}-->
          	<img src="<!--{response.application_config.qiniu_domain+response.type_parent_get.type_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle">
          	<!--/if-->	
          	<div>父级分类ID：<!--{response.type_parent_get.type_id}--></div>
			<div>父级分类名称：<!--{response.type_parent_get.type_name}--></div>
			<div>父级分类简介：<!--{response.type_parent_get.type_info}--></div>
			<div>父级分类模块：<!--helper{'module-name'(response.type_parent_get.type_module)}-->
				<span style="color: #999;"><span class="glyphicon glyphicon-tag"></span><!--{response.type_parent_get.type_module}--></span>
			</div>
			<div>更新时间：<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.type_parent_get.type_update_time) * 1000)}--></div>
			<div>操作：<button class="btn btn-default btn-xs" action-button="edit" data-id="<!--{response.type_parent_get.type_id}-->"><span class="glyphicon glyphicon-edit"></span>编辑</button></div>
		</div>
	</div>
	<!--/if-->
	
	
	<input name="image-files" type="file" style="left:-99999px;position:absolute;"/>
  	<button class="btn btn-default" type="button" action-button="add" <!--if{response.type_parent_get.type_id}-->data-parent-id="<!--{response.type_parent_get.type_id}-->"<!--/if--> ><span class="glyphicon glyphicon-plus"></span> 添加</button>
	<button class="btn btn-default" type="button" action-button="sort"><span class="glyphicon glyphicon-sort"></span> 排序</button>
	<button class="btn btn-default" type="button" action-button="state_show"><span class="glyphicon glyphicon-ok-sign"></span> 显示</button>
	<button class="btn btn-default" type="button" action-button="state_hide"><span class="glyphicon glyphicon-minus-sign"></span> 隐藏</button>
	<button class="btn btn-danger" type="button" action-button="remove"><span class="glyphicon glyphicon-trash"></span> 删除</button>
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
	
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th><input type="checkbox" action-table="checkbox-all"></th>	
          <th>#</th>
          <th>
          	<!--if{http().anchor.query.sort == "name_desc"}-->
          	<a href="javascript:;" action-sort="name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>分类名称</a>
          	<!--elseif{http().anchor.query.sort == "name_asc"}-->
          	<a href="javascript:;" action-sort="name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>分类名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="name_desc">分类名称</a>
          	<!--/if-->
          </th>
          <th>分类描述</th>
          <th>
          	<!--if{http().anchor.query.sort == "module_desc"}-->
          	<a href="javascript:;" action-sort="module_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>模块</a>
          	<!--elseif{http().anchor.query.sort == "module_asc"}-->
          	<a href="javascript:;" action-sort="module_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>模块</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="module_desc">模块</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "label_desc"}-->
          	<a href="javascript:;" action-sort="label_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>标签</a>
          	<!--elseif{http().anchor.query.sort == "label_asc"}-->
          	<a href="javascript:;" action-sort="label_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>标签</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="label_desc">标签</a>
          	<!--/if-->
          </th>
          <th>JSON配置</th>
          <th>
          	<!--if{http().anchor.query.sort == "state_desc"}-->
          	<a href="javascript:;" action-sort="state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>状态</a>
          	<!--elseif{http().anchor.query.sort == "state_asc"}-->
          	<a href="javascript:;" action-sort="state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="state_desc">状态</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "sort_desc"}-->
          	<a href="javascript:;" action-sort="sort_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>排序</a>
          	<!--elseif{http().anchor.query.sort == "sort_asc"}-->
          	<a href="javascript:;" action-sort="sort_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>排序</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sort_desc">排序</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "update_time_desc"}-->
          	<a href="javascript:;" action-sort="update_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>更新时间</a>
          	<!--elseif{http().anchor.query.sort == "update_time_asc"}-->
          	<a href="javascript:;" action-sort="update_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>更新时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="update_time_desc">更新时间</a>
          	<!--/if-->
          </th>
          
          <!--if{response.type_parent_get}-->
          <!--else-->
          <th>
          	<!--if{http().anchor.query.sort == "son_desc"}-->
          	<a href="javascript:;" action-sort="son_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>子级</a>
          	<!--elseif{http().anchor.query.sort == "son_asc"}-->
          	<a href="javascript:;" action-sort="son_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>子级</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="son_desc">子级</a>
          	<!--/if-->
          </th>
          <!--/if-->
          
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].type_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <th>
          <!--if{response.list.data[i].type_logo_image_id}-->
          <img class="img-circle image-look" src="<!--{response.application_config.qiniu_domain+response.list.data[i].type_logo_image_id+'?imageView2/1/w/40'}-->"  data-src="<!--{response.application_config.qiniu_domain+response.list.data[i].type_logo_image_id}-->" data-width="<!--{response.list.data[i].type_logo_image_width}-->" data-height="<!--{response.list.data[i].type_logo_image_height}-->" style="cursor: pointer;">
          <!--/if-->	
          <!--{response.list.data[i].type_name}-->
          </th>
          <td>
          	<div class="tips" data-title="查看分类简介" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 100px;cursor: pointer;" data="<!--{response.list.data[i].type_info}-->"><!--{response.list.data[i].type_info}--></div>
          </td>
          <td>
          <!--if{response.list.data[i].type_module}-->	
          <!--helper{'module-name'(response.list.data[i].type_module)}-->
          <div style="color: #999;"><span class="glyphicon glyphicon-tag"></span><!--{response.list.data[i].type_module}--></div>
          <!--else-->
          -
          <!--/if-->
          </td>
          
          <td>
          <!--{response.list.data[i].type_label}-->
          <!--if{response.list.data[i].type_comment}-->
          <div style="color: #999;">#<!--{response.list.data[i].type_comment}--></div>
          <!--/if-->
          </td>
          
          <td>
          	<div class="tips" data-title="查看JSON参数" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 100px;cursor: pointer;" data="<!--{response.list.data[i].slideshow_json}-->"><!--{response.list.data[i].slideshow_json}--></div>
          </td>
          
          <td>
          <!--if{parseInt(response.list.data[i].type_state)}-->
          <span class="label label-success">显示</span>
          <!--else-->
          <span class="label label-danger">隐藏</span>
          <!--/if-->
          </td>
          <td><input style="width: 50px;" type="text" class="form-control" placeholder="排序" action-table="sort" data-id="<!--{response.list.data[i].type_id}-->" value="<!--{response.list.data[i].type_sort}-->"></td>
          
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].type_update_time) * 1000)}--></td>
          
          <!--if{response.type_parent_get}-->
          <!--else-->
          <td><a href="#/application/type/?search=%257B%2522type_parent_id%2522%253A%2522<!--{response.list.data[i].type_id}-->%2522%257D"><!--{response.list.data[i].type_son_count}-->个</a></td>
          <!--/if-->
          
          <td>
          	<button class="btn btn-default btn-sm" action-button="edit" data-id="<!--{response.list.data[i].type_id}-->"><span class="glyphicon glyphicon-edit"></span>编辑</button>
      		<!--if{response.type_parent_get}-->
      		<!--else-->
	    	<button class="btn btn-default btn-sm" action-button="add" data-parent-id="<!--{response.list.data[i].type_id}-->"><span class="glyphicon glyphicon-plus"></span>添加子级</button>
	    	<a href="#/application/type/?search=%257B%2522type_parent_id%2522%253A%2522<!--{response.list.data[i].type_id}-->%2522%257D" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-share"></span>查看子级</a>
	    	<!--/if-->
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="12" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
	
</script>




<script id="add" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
	    	<label>LOGO图片：
	    		<button type="button" class="btn btn-default btn-xs" name="image-select">选择图片</button>
	    		<button type="button" class="btn btn-default btn-xs" name="image-clear">取消图片</button>
	    	</label>
	    	<div>
	    	<img name="type_logo_image_id" class="image-look" src="<!--{file.src}-->" style="max-height: 50px; cursor: pointer;display: none;">
	    	</div>
	  	</div>
		
		<div class="form-group">
	    	<label>分类名称：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的名称" name="type_name">
	  	</div>
	  	<div class="form-group">
	    	<label>分类简介：</label>
	    	<textarea class="form-control" rows="2" placeholder="输入分类的简介" name="type_info"></textarea>
	  	</div>
	  	<div class="form-group">
	    	<label>父级：</label>
		  	<select class="form-control" name="type_parent_id">
			  <option value="">-顶级-</option>
			  <!--if{response.type_option}-->
			  <!--for{var i in response.type_option}-->
			  <option value="<!--{response.type_option[i].type_id}-->" <!--if{parent_data.type_id == response.type_option[i].type_id}-->selected="selected"<!--/if--> ><!--{response.type_option[i].type_name}--></option>
			  <!--/for-->
			  <!--/if-->
			</select>
	  	</div>
	  	
	  	<div class="form-group">
	    	<label>分类模块：</label>
		  	<select class="form-control" name="type_module">
			  <option value="">-请选择模块-</option>
			  <!--if{response.type_module_option}-->
			  <!--for{var i in response.type_module_option}-->
			  <option value="<!--{i}-->" <!--if{parent_data.type_module == i}-->selected="selected"<!--/if-->  ><!--{response.type_module_option[i]}--></option>
			  <!--/for-->
			  <!--/if-->
			</select>
	  	</div>
	  	<div class="form-group">
	    	<label>标签：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的标签" name="type_label">
	  	</div>
	  	<div class="form-group">
	    	<label>注释：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的注释" name="type_comment">
	  	</div>
	  	<div class="form-group">
	    	<label>JSON配置：</label>
	    	<textarea class="form-control" rows="2" placeholder="输入分类的JSON配置" name="type_json"></textarea>
	  	</div>
	  	<div class="form-group">
	    	<label>排序：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的排序" name="type_sort">
	  	</div>
	  	<div class="form-group">
	    	<label>是否隐藏：</label>
	    	<label class="checkbox-inline">
				<input type="checkbox" value="0" name="type_state"> 是
			</label>
	  	</div>
	  	<br/>
	  	<button type="button" class="btn btn-primary btn-block" name="add-submit">确定添加</button>
	</div>
</script>







<script id="edit" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
	    	<label>LOGO图片：
	    		<button type="button" class="btn btn-default btn-xs" name="image-select">选择图片</button>
	    		<button type="button" class="btn btn-default btn-xs" name="image-clear">取消图片</button>
	    	</label>
	    	<div>
	    	<img name="type_logo_image_id" class="image-look" src="<!--{file.src}-->" style="max-height: 50px; cursor: pointer;display: none;">
	    	<!--if{edit_data.type_logo_image_id}-->
          	<img src="<!--{response.application_config.qiniu_domain+edit_data.type_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle">
          	<!--/if-->
          	</div>
	  	</div>
		
		<div class="form-group">
	    	<label>分类ID：</label>
	    	<input type="text" class="form-control" readonly="readonly" name="type_id" value="<!--{edit_data.type_id}-->">
	  	</div>
		<div class="form-group">
	    	<label>分类名称：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的名称" name="type_name" value="<!--{edit_data.type_name}-->">
	  	</div>
	  	<div class="form-group">
	    	<label>分类简介：</label>
	    	<textarea class="form-control" rows="2" placeholder="输入分类的简介" name="type_info"><!--{edit_data.type_info}--></textarea>
	  	</div>
	  	<div class="form-group">
	    	<label>父级：</label>
		  	<select class="form-control" name="type_parent_id">
			  <option value="">-顶级-</option>
			  <!--if{response.type_option}-->
			  <!--for{var i in response.type_option}-->
			  <option value="<!--{response.type_option[i].type_id}-->" <!--if{edit_data.type_parent_id == response.type_option[i].type_id}-->selected="selected"<!--/if--> ><!--{response.type_option[i].type_name}--></option>
			  <!--/for-->
			  <!--/if-->
			</select>
	  	</div>
	  	
	  	<div class="form-group">
	    	<label>分类模块：</label>
		  	<select class="form-control" name="type_module">
			  <option value="">-请选择模块-</option>
			  <!--if{response.type_module_option}-->
			  <!--for{var i in response.type_module_option}-->
			  <option value="<!--{i}-->" <!--if{edit_data.type_module == i}-->selected="selected"<!--/if--> ><!--{response.type_module_option[i]}--></option>
			  <!--/for-->
			  <!--/if-->
			</select>
	  	</div>
	  	<div class="form-group">
	    	<label>标签：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的标签" name="type_label" value="<!--{edit_data.type_label}-->">
	  	</div>
	  	<div class="form-group">
	    	<label>注释：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的注释" name="type_comment" value="<!--{edit_data.type_comment}-->">
	  	</div>
	  	<div class="form-group">
	    	<label>JSON配置：</label>
	    	<textarea class="form-control" rows="2" placeholder="输入分类的JSON配置" name="type_json"><!--{edit_data.type_json}--></textarea>
	  	</div>
	  	<div class="form-group">
	    	<label>排序：</label>
	    	<input type="text" class="form-control" placeholder="输入分类的排序" name="type_sort" value="<!--{edit_data.type_sort}-->">
	  	</div>
	  	<div class="form-group">
	    	<label>是否隐藏：</label>
	    	<label class="checkbox-inline">
				<input type="checkbox" value="0" name="type_state" <!--if{parseInt(edit_data.type_state)}--><!--else-->checked="checked"<!--/if--> > 是
			</label>
	  	</div>
	  	<br/>
	  	<button type="button" class="btn btn-primary btn-block" name="edit-submit">确定编辑</button>
	</div>
</script>





<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>分类ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的分类ID" name="type_id" value="<!--{search.type_id}-->">
		</div>
		<div class="form-group">
		    <label>分类名称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的分类名称" name="type_name" value="<!--{search.type_name}-->">
		</div>
		<div class="form-group">
		    <label>分类标签：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的分类标签" name="type_label" value="<!--{search.type_label}-->">
		</div>
		<div class="form-group">
		    <label>父级分类ID：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的父级分类ID" name="type_parent_id" value="<!--{search.type_parent_id}-->">
		</div>
		
		<div class="form-group">
	    	<label>分类模块：</label>
		  	<select class="form-control" name="type_module">
			  <option value="">-请选择模块-</option>
			  <!--if{response.type_module_option}-->
			  <!--for{var i in response.type_module_option}-->
			  <option value="<!--{i}-->" <!--if{search.type_module == i}-->selected="selected"<!--/if--> ><!--{response.type_module_option[i]}--></option>
			  <!--/for-->
			  <!--/if-->
			</select>
	  	</div>
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>



